package com.atguigu.gmall.seckill.mapper;

import com.atguigu.gmall.model.activity.SeckillGoods;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

/**
 * projectName: gmall
 *
 * @author: 陈鹏
 * time: 2022/10/17 19:30 星期一
 * description:
 */
@Mapper
public interface SecKillGoodsMapper extends BaseMapper<SeckillGoods> {

    @Update("update seckill_goods set stock_count = #{stock} where id = #{goodsId}")
    public int updateSeckillGoodsStock(@Param("goodsId") Long goodsId,
                                       @Param("stock") Integer stock);
}
